﻿using Microsoft.EntityFrameworkCore;
using TestCluster.usermodels;
using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore;

namespace TestCluster
{
    /// <summary>
    /// 
    /// </summary>
    [ConnectionStringName(TestClusterDbProperties.ConnectionStringName)]
    public class TestClusterDbContext : AbpDbContext<TestClusterDbContext>, ITestClusterDbContext
    {
        /* Add DbSet for each Aggregate Root here. Example:
         * public DbSet<Question> Questions { get; set; }
         */
        /// <summary>
        /// 
        /// </summary>
        /// <param name="options"></param>
        public TestClusterDbContext(DbContextOptions<TestClusterDbContext> options)
            : base(options)
        {

        }


        /// <summary>
        /// 
        /// </summary>
        /// <param name="builder"></param>
        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);

            builder.ConfigureTestCluster();


        }

        /// <summary>
        /// 用户信息
        /// </summary>
        public DbSet<UserInfo> UserInfo { get; set; }
        /// <summary>
        /// 权限信息
        /// </summary>
        public DbSet<RoleInfo> RoleInfo { get; set; }
        /// <summary>
        /// 角色信息
        /// </summary>
        public DbSet<GradeInfo> GradeInfo { get; set; }
        /// <summary>
        /// 角色权限
        /// </summary>
        public DbSet<GradeRole> GradeRole { get; set; }
        /// <summary>
        /// 部门信息
        /// </summary>
        public DbSet<PartInfo> PartInfo { get; set; }
        /// <summary>
        /// 部门信息
        /// </summary>
        public DbSet<BindUserPart> BindUserPart { get; set; }



    }
}